package com.smart_environmental_protection.controller;

import com.smart_environmental_protection.pojo.Content;
import com.smart_environmental_protection.pojo.DetaMol;
import com.smart_environmental_protection.pojo.User;
import com.smart_environmental_protection.service.ContentService;
import com.smart_environmental_protection.service.DetaMolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class DetaMolController {
    @Autowired
    private DetaMolService detaMolService;
    @PostMapping("/system/integral")
    public Map<String,Object> InsertMol(@RequestBody DetaMol detaMol){
        Map map=new HashMap<String,Object>();
        int  deta1=detaMolService.InsertMol(detaMol);
      if (deta1>0){ map.put("success",true);
            map.put("msg","成功");
            map.put("code",200);
        }else {
            map.put("success",false);
            map.put("msg","失败");
        }
        return map;
    }


}
